//
//  NetworkManager.h
//  NetworkDemo
//
//  Created by 万孟超 on 2021/9/7.
//

#import <Foundation/Foundation.h>
#import "NetworkBaseRequest.h"

NS_ASSUME_NONNULL_BEGIN

typedef void(^CompletionBlock)(id _Nullable result);
typedef void(^ErrorBlock)(NSError * _Nullable error);
typedef void(^ProgressBlock) (NSProgress * _Nullable progress);

@interface NetworkManager : NSObject

/// 初始化AFN对象
+ (instancetype)defaultManager;

/// 发起请求
/// @param request 入参Model
/// @param enginePoint 请求唯一标志
/// @param progressBlock 进度回调
/// @param completeBlock 成功回调
/// @param errorBlock 失败回调
- (void)POSTWithRequest:(NetworkBaseRequest *)request
            enginePoint:(NSString *)enginePoint
          progressBlock:(nullable ProgressBlock)progressBlock
           successBlock:(nullable CompletionBlock)completeBlock
             errorBlock:(nullable ErrorBlock)errorBlock;

@end

NS_ASSUME_NONNULL_END
